<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="../gvis.js"></script>
<?php

    // note sure yet how to implement a value format for a table cell 
    // for example where the value is 1000 and the formattted value is $1,000
  	require_once '../classes/gvisWriter.php';
  	$gvisJSObject = new gvisWriter(1,'table', 'table_div1', "showRowNumber: true", "chart1.data.setFormattedValue(0,2,'FORMATTEDVALUESTR');");
  	$gvisJSObject->addColType(array('State','string'));
   	$gvisJSObject->addColType(array('State Bird', 'string'));
   	$gvisJSObject->addColType(array('Population', 'number'));
   	$gvisJSObject->addColType(array('Visited?', 'boolean'));   	 	
	$gvisJSObject->addRow(array('Virginia', 'Cardinal (Cardinalis cardinalis)', 7643000, "true"));
	$gvisJSObject->addRow(array('Florida', 'Mockingbird (Mimus polyglottos)', 18090000, "true"));
	$gvisJSObject->addRow(array('North Dakota', 'Western Meadowlark (Sturnella neglecta)', 635867, "false"));			
  	echo $gvisJSObject->getScriptString();
?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Example gvisWriter.php Table with userInserted JS Code</title>
</head>
<body>
	<br/>
    <div id='table_div1'></div>
</body>
</html>